//
//  NetworkTool.h
//  
//
//  Created by admin on 17/3/2.
//  Copyright © 2017年 admin. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
#import <Foundation/Foundation.h>
#define kNetworkTool [NetworkTool sharedInstance]

//@interface NetworkTool : NSObject//AFHTTPSessionManager
@interface NetworkTool : AFHTTPSessionManager
//单例模式类
+ (instancetype)sharedInstance;


/**
 GET获取数据的主方法

 @param urlString 请求地址
 @param parameters 请求参数
 @param successBlock 成功回调
 @param failureBlock 失败回调
 */
- (void)GETWithUrlString:(NSString *)urlString parameters:(id)parameters success:(void(^)(id responseObject))successBlock failure:(void(^)(NSError *error))failureBlock;
/**
 POST获取数据的主方法
 
 @param urlString 请求地址
 @param parameters 请求参数
 @param successBlock 成功回调
 @param failureBlock 失败回调
 */
- (void)POSTWithUrlString:(NSString *)urlString parameters:(id)parameters success:(void(^)(id responseObject))successBlock failure:(void(^)(NSError *error))failureBlock;

- (void)PostYunTouTiaoWithUrlString:(NSString *)urlString input:(id)input success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;

- (void)uploadYunTouTiaoWithUrlString :(NSString *)urlString input:(id)input dataImage:(NSData*)dataImage  filePath:(NSString *)filePath success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;

@end
